<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <link rel="icon" type="image/x-icon" th:href="${application.iconPath}"/>
    <div th:include="../templates/common::html_header"></div>
    <title class="projectName"></title>

    <link rel="stylesheet" th:href="@{{path}/index/css/global.css(path=${application.basePath}) }" media="all"/>

</head>
<input type="hidden" th:value="${isLogin}" id="isLogin"/>
<script>
    var isLogin = $("#isLogin").val();
    if (isLogin == "false") {
        location.href = basePath + "/index/login";
    }
</script>
<body>
<div class="layui-layout layui-layout-admin" style="border-bottom: solid 5px #1aa094;">
    <div class="layui-header header header-demo" style="">
        <div class="layui-main" style="background-color: #ededef;">
            <div class="admin-login-box">
                <a class="logo" style="left: 0;" href="#"> <span style="font-size: 22px;" class="projectName"></span>
                </a>
                <div class="admin-side-toggle">
                    <i class="layui-icon icon_sysmenu">&#xe603;</i>
                    <input type="hidden" value="1"/>
                </div>
                <div class="admin-side-full">
                    <i class="layui-icon">&#xe619;</i>
                </div>
            </div>
            <ul class="layui-nav admin-header-item">
                <li class="layui-nav-item">
                    <a href="javascript:;">角色名称</a>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;" class="admin-header-user"> <img id="index_userimg"/> <span id="userName">用户名称</span>
                    </a>
                    <dl class="layui-nav-child">
                        <dd>
                            <a href="javascript:;" class="header_a_info"><i class="fa fa-user-circle" aria-hidden="true"></i> 个人信息</a>
                        </dd>
                        <dd>
                            <a href="javascript:;" class="header_a_updatePwd"><i class="fa fa-gear" aria-hidden="true"></i>修改密码</a>
                        </dd>
                        <dd id="lock">
                            <a href="javascript:;"> <i class="fa fa-lock" aria-hidden="true" style="padding-right: 3px; padding-left: 1px;"></i> 锁屏 (Alt+L)
                            </a>
                        </dd>
                        <dd>
                            <a href="javascript:;" class="header_a_zhuxiao"><i class="fa fa-sign-out" aria-hidden="true"></i> 注销</a>
                        </dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>
    <div class="layui-side layui-bg-black" id="admin-side">
        <div class="layui-side-scroll" id="admin-navbar-side" lay-filter="side"></div>
    </div>
    <div class="layui-body" style="bottom: 0; border-left: solid 2px #1AA094;" id="admin-body">
        <div class="layui-tab admin-nav-card layui-tab-brief" lay-filter="admin-tab">
            <ul class="layui-tab-title">
                <li class="layui-this">
                    <i class="fa fa-dashboard" aria-hidden="true"></i>
                    <cite>控制面板</cite>
                </li>
            </ul>
            <div class="layui-tab-content" style="min-height: 150px; padding: 5px 0 0 0;">
                <div class="layui-tab-item layui-show">
                    <iframe name="rightFrame" th:src="@{{path}/page/sso~system(path=${application.basePath}) }"></iframe>
                </div>
            </div>
        </div>
    </div>
    <div class="layui-footer footer footer-demo" id="admin-footer">
        <div class="layui-main">
            <p>2018 &copy; kim.sesame</p>
        </div>
    </div>
    <div class="site-tree-mobile layui-hide">
        <i class="layui-icon">&#xe602;</i>
    </div>
    <div class="site-mobile-shade"></div>

    <!--锁屏模板 start-->
    <script type="text/template" id="lock-temp">
        <div class="admin-header-lock" id="lock-box">
            <div class="admin-header-lock-img">
                <img src="/im/istyle/images/0.jpg"/>
            </div>
            <div class="admin-header-lock-name" id="lockUserName">beginner</div>
            <input type="text" class="admin-header-lock-input" value="输入密码解锁.." name="lockPwd" id="lockPwd"/>
            <button class="layui-btn layui-btn-small" id="unlock">解锁</button>
        </div>
    </script>
    <!--锁屏模板 end -->
    <script th:src="@{{path}/index/js/index.js(path=${application.basePath}) }"></script>
    <script>
        layui.use(['layer', 'user', 'web'], function () {
            var $ = layui.jquery, layer = layui.layer;
            var user = layui.user;
            var web = layui.web;

            var account = user.getUser().account;
            $("#userName").html(user.getUser().account);
            $("#index_userimg").attr("src", user.getUser().txurl);

            //修改个人信息
            $(".header_a_info").click(function () {
                var ifame_height = '700px'; //弹出层的高度

                var index_edit = layer.open({
                    title: ['编辑个人信息', font_set]
                    , type: 2
                    , fixed: false
                    , maxmin: true
                    , area: ['600px', ifame_height] //宽,高
                    , offset: ['50px', '300px']// top,left
                    , content: web.url_replace('sso/user/ssouser_edit?id=' + user.getUser().id)
                });
            });
            $(".header_a_updatePwd").click(function () {
                var ifame_height = '400px'; //弹出层的高度
                var index_edit = layer.open({
                    title: ['修改登录密码', font_set]
                    , type: 2
                    , fixed: false
                    , maxmin: true
                    , area: ['600px', ifame_height] //宽,高
                    , offset: ['200px', '300px']// top,left
                    , content: web.url_replace('sso/user/update_pwd')
                });
            });

            $(".header_a_zhuxiao").click(function () {
                web.load();
                web.ajax(basePath + "/user/invalid", 'post', {}, function () {
                    location.reload();
                });
            });

            var arr_icon = new Array();

            $(".icon_sysmenu").click(function () {
                var val = $(this).next().val();
                if (val == "1") {
                    $(this).next().val("2");
                    $(".icon_sysmenu").html('&#xe602;');
                }
                if (val == "2") {
                    $(this).next().val("1");
                    $(".icon_sysmenu").html('&#xe603;');
                }
            });
        })
        ;

    </script>
</div>
</body>
<div th:include="../templates/common::html_footer"></div>
</html>
